package com.springdemo.spring5.TestSpringDemo;

import com.springdemo.spring5.Book;
import javafx.application.Application;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created with IntelliJ IDEA.
 * User: zjz
 * Date: 2022/02/22 12:59
 * Description:
 * Version: V1.0
 */
public class TestDemo {

    @Test
    public void TestAdd(){
        //1.加载spring配置文件
        ApplicationContext context= new ClassPathXmlApplicationContext("bean1.xml");

        //2. 获取配置创建的对象
        Book book =context.getBean("book",Book.class);


        System.out.println(book);
        book.testDemo();

    }
}
